<template>
  <el-form label-width="80px" :model="movieForm">
    <el-form-item label="电影名称">
      <el-input v-model="movieForm.nm"></el-input>
    </el-form-item>
    <el-form-item label="主演">
      <el-input v-model="movieForm.star"></el-input>
    </el-form-item>
    <el-form-item label="海报">
      <el-input v-model="movieForm.img"></el-input>
    </el-form-item>
    <el-form-item label="上映时间">
      <el-date-picker
        v-model="movieForm.date"
        type="date"
        placeholder="选择日期"
      ></el-date-picker>
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="submitForm('ruleForm')">提交</el-button>
    </el-form-item>
  </el-form>
</template>

<script>
import { mapMutations } from 'vuex'
export default {
  data() {
    return {
      movieForm: {
        nm: '',
        id: '',
        img: '',
        date: '',
        star: '',
      },
    }
  },
  methods: {
    submitForm() {
      console.log('form组件内部：')
      this.$listeners.click(this.movieForm)
      // this.$listeners.click(this.movieForm)
      // console.log(this.set_form_data)
      // this.$store.commit('set_form_data', this.movieForm)
      // this.set_form_data(this.movieForm)
    },
  },
}
</script>

<style></style>
